package com.bestcem.xm.award.service.dto.requestaward;

import com.bestcem.xm.award.entity.pojo.AwardAwardDO;
import com.bestcem.xm.award.enums.AwardTypeEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * 奖励方式为抽奖，返回结果
 *
 * @author jie.yao <jie.yao@idiaoyan.com>
 * @version v1.0
 * @date 2021/7/1 20:03
 */
@ToString
@NoArgsConstructor
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DrawAwardDTO {

    /**
     * 奖励类型 {@link AwardTypeEnum}
     */
    @JsonProperty("ttype")
    private Integer tType;

    /**
     * 抽奖奖项列表
     */
    private List<AwardAwardDO.Award> awards;

    /**
     * 抽奖发放相关信息
     */
    private AwardAwardDO.Issue issue;

    /**
     * 给奖励页面返回唯一标识，抽奖时需要验证该奖励是否抽过奖
     */
    private Award award;

    /**
     * 给奖励页面返回唯一标识，抽奖时需要验证该奖励是否抽过奖
     */
    @ToString
    @NoArgsConstructor
    @Getter
    @Setter
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Award {

        /**
         * 奖励id
         */
        private String awardId;

        /**
         * 投放id
         */
        private String deliverId;

        /**
         * 答卷id
         */
        private String surveyId;

        /**
         * 答卷唯一标识
         */
        private Long surveySeq;

        /**
         * 页面标识
         * 刚好survey的seq就是唯一标识，所以直接拿来用
         */
        private String awardPage;

        /**
         * 签名
         */
        private String sig;
    }
}
